/*** vender ***/
package main;

public class Contact {

  public static final int HEADERS_NUMBER = 3;
  public static final String[] HEADERS = new String[]{"Nome", "Telefone", "E-mail"};
  private String name;
  private String phone;
  private String email;

  public Contact(String name, String phone, String email) {
    this.name  = (name == null)  ? "" : name;
    this.phone = (phone == null) ? "" : phone;
    this.email = (email == null) ? "" : email;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String[] toArray() {
    return new String[]{name, phone, email};
  }

  public boolean equals(Contact c) {
    return (this.name.equalsIgnoreCase(c.name) &&
            this.phone.equalsIgnoreCase(c.phone) &&
            this.email.equalsIgnoreCase(c.email));
  }
}
